<?php /*a:3:{s:63:"D:\wwwroot\127.0.0.1\app\admin\view\attachment/imagebox_add.vue";i:1690771764;s:50:"D:\wwwroot\127.0.0.1\app\admin\view\index/meta.vue";i:1691032692;s:52:"D:\wwwroot\127.0.0.1\app\admin\view\index/footer.vue";i:1690447759;}*/ ?>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo get_config('site_name'); ?> - 后台管理</title>
    <link rel="stylesheet" type="text/css" href="/static/css/layui.css" /><link rel="stylesheet" type="text/css" href="/static/css/bootstrap.css" /><link rel="stylesheet" type="text/css" href="/static/css/mian.css" /><script type="text/javascript" src="/static/js/jquery.min.js"></script><script type="text/javascript" src="/static/js/bootstrap.bundle.min.js"></script><script type="text/javascript" src="/static/js/layui.js"></script> <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/c/font_4112823_w668vgmca4.css" />
    </head>
<div role="dialog" aria-modal="true" aria-label="选择图片" class="el-overlay-dialog">
    <div class="el-dialog attachment-dialog">
    
        <div  class="el-dialog__body">
            <div class="flex border-t border-b main-wrap border-color w-full h-[40vh]">
            
                <div class="attachment-list-wrap flex flex-col p-[15px] flex-1 overflow-hidden">
                    <div class="el-row h-[32px]" style="margin-left: -7.5px; margin-right: -7.5px;">
                        <div class="el-col el-col-10 is-guttered" style="padding-right: 7.5px; padding-left: 7.5px;">
                            <div class="flex">
                                <div >
                                  <div class="el-upload el-upload--text" tabindex="0">
                                      <button class="el-button el-button--primary" id="ID-upload-demo-form-files" type="button">
                                        上传图片</button>
                                      </div>
                                  <ul class="el-upload-list el-upload-list--text"></ul>
                                </div>
                              </div>
                        </div>
                     
                    </div>
                    <div class="flex-1 my-[15px] h-0">
                        <div class="el-scrollbar">
                            <div class="el-scrollbar__wrap el-scrollbar__wrap--hidden-default">
                                <div class="el-scrollbar__view" style="">
                                    <div class="flex">
                                     <div class="flex flex-wrap">
                                          <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?>
                                            <div class="attachment-item mr-[10px] w-[100px]">
                                                <div  class="attachment-wrap w-full rounded cursor-pointeroverflow-hidden relative flex items-center justify-center h-[100px]">
                                                    <div class="el-image">
                                                        <img   class="el-image__inner cursor-pointer" onclick="album_cancel('/storage/<?php echo htmlentities($data['originname']); ?>','mini_<?php echo htmlentities($data['id']); ?>')" src="/storage/<?php echo htmlentities($data['originname']); ?>"  path="/storage/<?php echo htmlentities($data['originname']); ?>">
                                                        </div>
                                                    <div id="mini_<?php echo htmlentities($data['id']); ?>"  onclick="album_close('mini_<?php echo htmlentities($data['id']); ?>')" class="absolute z-[1] flex items-center justify-center post-tab-toggle w-full h-full inset-0 bg-black bg-opacity-60" style="display: none;">
                                                        <i class="el-icon icon el-icon" style="color: rgb(255, 255, 255); font-size: 40px;">
                                                            <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
                                                                <path fill="currentColor" d="M77.248 415.04a64 64 0 0 1 90.496 0l226.304 226.304L846.528 188.8a64 64 0 1 1 90.56 90.496l-543.04 543.04-316.8-316.8a64 64 0 0 1 0-90.496z"></path>
                                                            </svg>
                                                        </i>
                                                    </div>
                                                </div>
                                                <div class="flex items-center">
                                                    <div class="truncate my-[10px] cursor-pointer text-base flex-1 text-center el-tooltip__trigger el-tooltip__trigger"><?php echo htmlentities($data['filename']); ?></div>
                                                   </div>
                                           
                                             </div>
                                            <?php endforeach; endif; else: echo "" ;endif; ?>
                                             </div>
                                        
                                    </div>
                                    <?php echo $list; ?>
                                </div>
                            </div>
                            
                        </div>
                    </div>

                </div>
                </div>
        </div>
        <footer class="el-dialog__footer pd-pos">
            <span class="dialog-footer">
                <button class="el-button el-button--danger"  id="closes"  type="button">
                 取消</button>
                <button class="el-button el-button--primary" id="determine" type="button">
                  确认</button>
            </span>
        </footer>
    </div>
</div>
<div id="att_status" style="display:none"></div>
<script type="text/javascript">
 window._win = {}
</script>
<script type="text/javascript" src="/static/js/mian.js"></script>
<script>
layui.use(function(){
  var upload = layui.upload;
  var layer = layui.layer
  // 渲染
  upload.render({
    elem: '#ID-upload-demo-form-files',
    url: '<?php echo url('upload'); ?>', // 此处配置你自己的上传接口即可
    before: function(obj){
       layer.msg('上传中', {icon: 16, time: 0});  
    },
    done: function(res){
    if(res.code == 200){
         layer.msg(res.msg, {icon:1,time: 2000}, function(){
			window.location.reload();
		});
      }    
      else{
        layer.msg(res.msg, {icon:2});   
      }
      console.log(res)
    }
  });
});
</script>
<script>
$('#determine').on('click',function() {
    var att_status = $("#att_status").html();
    if (att_status =='') {
        layer.alert('你还没选择附件呢？');
        return false;
    }
   	parent.$("#<?php echo htmlentities($id); ?>").val(att_status);
    var index = parent.layer.getFrameIndex(window.name);
	parent.layer.close(index);

});
$('#closes').on('click',function() {
   var index = parent.layer.getFrameIndex(window.name);
	parent.layer.close(index);
});
function album_cancel(obj,id) {
    var strs = '';
    $('.post-tab-toggle').attr("style","display:none");
    var id = $('#'+id+'');
    var status = $('#att_status');
    id.attr("style","display:inherit");
    status.html(strs);
    status.text(obj);
}
function album_close(id) {
    var id = $('#'+id+'');
    id.attr("style","display:none");
    $("#att_status").html('');
}

</script>